<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="x-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

 <div class="container-fluid x-container has-x-sidemenu">

    <ol class="x-breadcrumb breadcrumb">
      <li class="active">挑战审核&nbsp;-&nbsp;挑战审核列表</li>
    </ol>
    <div class="x-content-layout">
      <div class="x-operation-bar no-margin no-bottom-border clearfix">
       
        <ul class="nav nav-tabs x-nav-tabs" role="tablist">
        	<li role="presentation" class="${status.paid ? 'active' : ''}"><a href="${ctx.host}/userbets?status=PAID">待开启审核</a></li>
          <li role="presentation" class="${status.open ? 'active' : ''}"><a href="${ctx.host}/userbets?status=OPEN">开启挑战审核</a></li>
          <li role="presentation" class="${status.processing ? 'active' : ''}"><a href="${ctx.host}/userbets?status=PROCESSING">挑战进行中</a></li>
          <li role="presentation" class="${status.close ? 'active' : ''}"><a href="${ctx.host}/userbets?status=CLOSE">结束挑战审核</a></li>
          <li role="presentation" class="${status.finished ? 'active' : ''}"><a href="${ctx.host}/userbets?status=FINISHED">挑战已结束</a></li>
        </ul> 
       <!-- <div class="x-operation-bar no-margin no-bottom-border clearfix">
					<div class="x-operation-group">
						<div class="pull-right">
							<a href="${ctx.host}/orders/search?status=${status}" data-target="#search"
								data-toggle="modal" class="btn x-btn x-btn-blue"> <i
								class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
							</a>
						</div>
					</div>
				</div>-->
					</div>
					</div>
       <table class="table table-hover x-table">
        <thead>
          <tr>
           <th>用户</th>
           <th>所属赌局</th>
           <th>挑战前</th>
           <th>挑战后</th>
           <th>创建时间</th>
           <th>是否成功</th>
           <th class="text-center">操作</th>
          </tr>
        </thead>
        <tbody>
          <c:forEach items="${userBets}" var="userBets">
             <tr>
               <td>${userBets.user.nickname} <br /> ${userBets.user.mobile}</td>
               <td>${userBets.bet.name}</td>
               <td>
                 <c:if test="${not empty userBets.beforeWeight}">
                   ${userBets.beforeWeight} KG <br />
                   <a href="${userBets.beforeVedio}" target="_BLANK">${userBets.beforeVedio}</a>
                 </c:if>
                 <c:if test="${empty userBets.beforeWeight}">
                   暂未上传
                 </c:if>
               </td>
               <td>
                 <c:if test="${not empty userBets.afterWeight}">
                   ${userBets.afterWeight} KG <br />
                   <a href="${userBets.afterVedio}" target="_BLANK">${userBets.afterVedio}</a>
                 </c:if>
                 <c:if test="${empty userBets.afterWeight}">
                   暂未上传
                 </c:if>
               </td>
               <td>
                 <fmt:formatDate value="${userBets.createTime}" pattern="yyyy-MM-dd HH:mm" />
               </td>
               <td>
                 <c:if test="${userBets.status == 'FINISHED'}">
                   ${userBets.success ? '挑战成功' : '挑战失败'}
                 </c:if>
                 <c:if test="${userBets.status != 'FINISHED'}">
                   暂无结果
                 </c:if>
               </td>
               <td class="text-center">
                 <c:choose>
                   <c:when test="${userBets.status == 'OPEN'}">
                     <a href="${ctx.host}/userbets/${userBets.id}/auth" data-toggle="modal" data-target="#auth">开启审核</a>&nbsp;&nbsp;
                   </c:when>
                   <c:when test ="${userBets.status == 'CLOSE'}">
                     <a href="${ctx.host}/userbets/${userBets.id}/close" data-toggle="modal" data-target="#closes">结束审核</a>	
                     
                   </c:when>
                 </c:choose>
                 <a href="${ctx.host}/userbets/${userBets.id}/view">详情</a>
               </td>
             </tr>
           </c:forEach>
         </tbody>
         <tfoot>
          <tr>
            <td colspan="14" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="${ctx.host}/userbets"/>
                   <jsp:param name="queryString" value="${queryString}"/>
                </jsp:include>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>
        
      </div>
    </div>
  </div>
  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
<d:resource type="script" root="${ctx.resource}/build"
		src="js/page/user-bet/user-bet-list.js" />
	<script type="text/javascript">
		require([ 'page/user-bet/user-bet-list' ], function(page) {
			page.init()
		})
	</script>
   
</body>
</html>